/*
 * @Description: 表单验证参数
 * @Author: James324
 * @Date: 2023-09-27 10:50:34
 * @LastEditors: James324
 * @LastEditTime: 2023-10-27 19:05:46
 */
import { generateRandomId, StrategyKey, InputType } from '@/utils';

export const formConfig: PageConfig = {
    id: generateRandomId(),
    items: [
        {
            modelKey: 'supplierCode',
            columnProps: {
                label: '供应商编码'
            },
            validProps: {
                id: generateRandomId(),
                required: true
            },
            elInputProps: {
                showWordLimit: true,
                maxlength: '50'
            },
            validFormatType: InputType.NUMERIC_ALPHABET_SYMBOLS
        },
        {
            modelKey: 'supplierName',
            columnProps: {
                label: '供应商名称'
            },
            elInputProps: {
                showWordLimit: true,
                maxlength: '50'
            },
            validProps: {
                id: generateRandomId(),
                required: true
            }
        },
        {
            modelKey: 'supplierPerson',
            itemType: 'other',
            columnProps: {
                label: '供应商姓名'
            },
            elInputProps: {
                showWordLimit: true,
                maxlength: '50'
            },
            validProps: {
                id: generateRandomId()
            }
        },
        {
            modelKey: 'supplierPhone',
            itemType: 'table',
            columnProps: {
                label: '供应商电话'
            },
            validProps: {
                id: generateRandomId()
            },
            validRules: [
                {
                    validType: StrategyKey.IS_MOBILE,
                    errMsg: '手机号格式不正确'
                }
            ],
            validFormatType: InputType.NUMBER
        }
    ]
};
